<include file="Public:pageHeader2024"/>
<!--主区域-->
<div class="mainBox on">
    <div class="my-page">
        <div class="wrapper"">
        <div class="my_p">
            <div class="my_form">
                <!-- 账户名称/手机号 -->
                <p class="m_p1">账户名称/手机号</p>
                <div class="m_p2">
                    <input type="text" id="loginusername" style="width: 100%;height: 40px;" placeholder="请输入账户名称/手机号">
                </div>
                <div class="line"></div>
                <!-- 账户密码 -->
                <p class="m_p1" style="margin-top: 20px;">账户密码</p>
                <div class="m_p2">
                    <input type="password" id="loginpassword" style="width: 100%;height: 40px;" placeholder="请输入账户密码">
                </div>
                <div class="line"></div>
                <!-- 图形验证码 -->
                <p class="m_p1" style="margin-top: 20px;">图形验证码</p>
                <div class="m_p2">
                    <input type="text" id="loginverify" placeholder="请输入图片验证码" maxlength="4" onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')"/>
                    <img src="/public/verifycode.html" onclick="javascript:refreshverifycode('regverifyimg')" style="width:100px;height:37px;cursor:pointer;vertical-align:bottom;" id="regverifyimg">
                </div>
                <div class="line"></div>
            </div>
            <div class="exit" id="memberLogin">立即登录</div>
        </div>
    </div>
</div>
</div>
<!--底部区域-->
<include file="Public:pageFooter" />
</body>
</html>
<script type="text/javascript">
    //账户登录
    $('#memberLogin').click(function(channel){
        $(this).blur();
        var data = {username: $('#loginusername').val(), password: $('#loginpassword').val(), verifycode: $('#loginverify').val()};
        if (data.username.length < 2 || data.username == '输入您的账号') {
            return errmsg('登录帐号不能为空');
        }
        if (data.password.length < 6) {
            return errmsg('密码不能小于6个字符');
        }
        if (data.verifycode.length < 4) {
            return errmsg('验证码不能小于4个字符');
        }
        $.ajax({
            url:"/member2024/dologin.html",
            data: {data: genboxdata(data)},
            cache: false,
            async: false,
            type: "POST",
            dataType: 'json',
            success: function(data){
                if( data.status == 0 ){
                    //刷新验证码
                    $('#regverifyimg').trigger("click");
                    return errmsg(data.msg);
                }else{
                    window.location.href="/member2024/best.html";
                    return false;
                }
            },
            error: function(){
                return errmsg("系统错误，请稍后重试或拨打官方客服电话进行反馈！");
            },
            complete: function (XHR, TS) {
                XHR = null;
            }
        })
    })
</script>